<?php include_once 'include/header.php'; ?>
<?php include_once 'albumcontroller.php'; ?>
<script type="text/javascript">
    $(document).ready(function() {
        $('#file_upload').uploadify({
            'uploader'  : 'js/uploadify2.4/uploadify.swf',
            'script'    : 'albumcontroller.php?catid='+$("#cat_album").val(),
            'cancelImg' : 'js/uploadify2.4/cancel.png',
            'folder'    : 'data/album',
            'multi'     : true,
            'auto'      : false,
            'queueSizeLimit' : 10,
            'scriptData'  : {'userid':<?php echo $_COOKIE["id"] ?>}
        });
    });
</script>

<div id="content">
    <?php include_once 'include/leftsidebar.php' ?>
    <div id="cmiddle">
        <div id="content-middle">           
            <div style="margin-top:20px">
                <div  style="line-height: 36px;height:36px;border-bottom:1px solid #ccc;margin-top:30px;background: url('Images/icon/album.png') no-repeat 5px center">
                    <b style="font-size: 1.5em;padding-left:30px">Upload hình ảnh lớp</b>
                </div> 
            </div>
            <div style="margin:10px;text-align: center;">
                <?php if(isset($_COOKIE["username"])){ ?>
                <input id="file_upload" name="file_upload" type="file" />
               <br/><br/>
                <a onclick="uploadfile();" href="#" class="button"><span class="icon plus"></span>Upload ảnh</a>
                <?php }else{ ?>
                <div style="text-align:center"><a href="register.php" class="button" onclick=""><span class="icon plus"></span>Đăng ký để đăng tin</a></div>
                <?php } ?>
            </div>
        </div>
    </div>
    <?php include_once 'include/rightsidebar.php'; ?>
</div>
<script type="text/javascript">
    function uploadfile(){
       
            
            $("#file_upload").uploadifyUpload();  
            
    }
</script>

<?php include_once 'include/footer.php' ?>